package com.aomiao.orderserver.entity;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

/**
 * @author xiah
 * @date 2018/5/11 18:11
 */
@Entity
@Table(name = "t_order")
@Data
@AllArgsConstructor
@NoArgsConstructor
/*屏蔽掉hibernateLazyInitializer属性  防止json、转化错误*/
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
public class Order implements Serializable{
       private static final long serialVersionUID = 1L;
       @Id
       @GeneratedValue(strategy = GenerationType.IDENTITY)
       private Long id;

       @Column(name = "user_id",nullable = false)
       private Long userId;

       @Column(name = "product_id",nullable = false)
       private Long productId;
       @Column(nullable = false)
       private Double money;
}
